package com.ai.bitcoin.jpa.service.impl;

import com.ai.bitcoin.jpa.dao.BccShowControlDao;
import com.ai.bitcoin.jpa.entity.BccShowControl;
import com.ai.bitcoin.jpa.service.BccShowControlService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author Jason
 * @date 2018/4/5
 **/
@Component
public class BccShowControlServiceImpl implements BccShowControlService {
    @Autowired
    BccShowControlDao dao;

    @Override
    public BccShowControl findByBccIdAndShowType(String bccId, String showType) {
        List<BccShowControl> list = dao.findByBccIdAndShowType(bccId, showType);
        if (list.size() == 1) {
            return list.get(0);
        } else {
            return null;
        }
    }
}
